package com.swpu.Services;

import com.swpu.Dao.bookMapper;
import com.swpu.Pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能描述：
 *
 * @Author: ygq
 * @Date: 2021/2/19 18:07
 */
@Service
public class BookServicesImpl  implements BookServices{

//    service 调用Dao

    private bookMapper bookMapper;

    public BookServicesImpl(com.swpu.Dao.bookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books QueryBookById(int id) {
        return bookMapper.QueryBookById(id);
    }

    @Override
    public List<Books> QueryAllBooks() {
        return bookMapper.QueryAllBooks();
    }

    @Override
    public List<Books> QueryBook(String bookName) {
        return bookMapper.QueryBook(bookName);
    }
}
